﻿@model LeadExpress.Models.MenuModel
           
@{
    string className=string.Empty;

    if (Model != null && Model.MenuList != null && Model.MenuList.Count > 0)
    {
        <ul id="nav" class="tabs">
            @foreach (var item in Model.MenuList)
            {           
                className = (item.CurrentMenu)?"active": "";
                                  
                if (item.SubItem != null && item.SubItem.Count > 0)
                {                                    
                    <li class="tab @className"><a href="@item.LinkUrl" class="top_link"><span class="down">@item.LinkText</span></a>
                        <ul class="sub">
                            @foreach (var sub in item.SubItem)
                            {
                                if(sub.SubItem!=null && sub.SubItem.Count>0)
                                {
                                    <li><a href="@sub.LinkUrl" class="fly">@sub.LinkText</a>
                                       @if(sub.SubItem!=null && sub.SubItem.Count>0)
                                       {
                                           <ul>
                                           @foreach(var temp in sub.SubItem)
                                           {
                                               <li><a href="@temp.LinkUrl">@temp.LinkText</a></li>
                                           }
                                           </ul>
                                       }
                                    </li>
                                }
                                else
                                {
                                    <li><a href="@sub.LinkUrl">@sub.LinkText</a></li>
                                }
                            }
                        </ul>
                    </li>
                }
                else
                {
                    <li class="tab @className"><a href="@item.LinkUrl" class="top_link"><span>@item.LinkText</span></a></li>
                }
            }
            
        </ul>
    }
}